package demo516;

import java.sql.SQLOutput;
import java.util.List;

public class TestList {
    public void addEmp(List<Emp> list, Emp emp) {
        list.add(emp);

    }

    public void findAllEmp(List<Emp> list) {
        for (Emp emp : list) {
            System.out.println(emp);
        }
    }

    public Emp findEmpName(List<Emp> list, String empName) {
        for (Emp emp : list) {
            if (empName.equals(emp.getName())) {
                return emp;
            }
        }
        return null;
    }


    public void deleteEmp(List<Emp> list, String empNumber) {
        for (int i = 0; i < list.size(); i++) {
            if (empNumber.equals(list.get(i).getNumber())) {
            }
        }
    }
    public void updateEmp(List<Emp> list, Emp emp) {
        for (int i = 0; i < list.size(); i++) {
            if (emp.getNumber().equals(list.get(i).getNumber())) {
                list.set(i, emp);
            }
        }
    }

    public  Emp findEmpNumber(List<Emp> list, String empNumber) {
        for (int i = 0; i < list.size(); i++) {
            if (empNumber.equals(list.get(i).getNumber())){
            }


        }return null;
    }

}
